<template>
    <div>
        <h2>入党申请公示</h2>
        <ul>
            <li v-for="stu in appliers">
                {{ stu.name }}
            </li>
        </ul>
    </div>
</template>

<script>
import { ref,computed} from "vue"
export default{
    name:'Publicity',
    components:{},
    setup(){
       const students=[
                    {name:'张三',isApply:true,is18:true},
                    {name:'王三',isApply:false,is18:true},
                    {name:'李三',isApply:true,is18:true},
                    {name:'赵三',isApply:true,is18:false},
                    {name:'郑三',isApply:true,is18:true},
                    {name:'叶三',isApply:true,is18:true},
                    {name:'钱三',isApply:true,is18:true},
                    {name:'龚三',isApply:false,is18:true},
                    {name:'和三',isApply:true,is18:false},
                    {name:'付三',isApply:true,is18:true},
                ]
        const appliers=computed(() =>{
            console.log("计算属性触发")
            return students.filter(stu=>stu.isApply&stu.is18)
        })

        return{
            students,
            appliers
        }
            }
    }   
                

</script>
